#!/bin/bash

help() {
  echo "Usage:"
  echo "  zcompose update <service_name> [options...]"
  # echo ""
  # echo "    -h, --help              Get help"
  # echo "    -u, --update <version>  Set new version"
}

core() {
   if [ "$1" = "" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
    help
    exit 0
  fi

  local service_name=$1
  local args=${@:2}

  # pull
  service::run $service_name pull $args
  # rollup
  service::run $service_name down $args
  service::run $service_name up -d $args
}

run() {
  core $@
}

run $@
